package com.yichi;

import android.graphics.Color;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.yichi.widget.RadiusBackgroundSpan;

public class QuDianConfirmFragment extends Fragment {
    private TextView tip;


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fg_qudian_confirm, container, false);
        tip = view.findViewById(R.id.qu_dian_tip);
        setView();
        return view;
    }

    private void setView() {
        SpannableString spannableString = new SpannableString("用户【张凤华】您好，\n 您选中了01号格口取电，是否确认？");
        RadiusBackgroundSpan backgroundColorSpan = new RadiusBackgroundSpan(Color.parseColor("#FFFFE60F"), 0, Color.BLACK, 28, 0, "01号");
        spannableString.setSpan(backgroundColorSpan, 16, 19, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
        tip.setText(spannableString);
    }
}
